package jzqb.dao.impl;

import cnki.tpi.kbatis.sqlsession.SqlSession;
import cnki.tpi.kbatis.utils.DataSourceUtil;
import jzqb.bo.ZTBo;
import jzqb.bo.ZTJBo;
import jzqb.bo.ZTWXBo;
import jzqb.common.Result;
import jzqb.dao.ZTJDao;
import jzqb.dao.ZTWXDao;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 自用库数据层实现类
 */
@Repository
public class ZTWXDaoImpl implements ZTWXDao {


    @Override
    public List<ZTWXBo> searchZtwxResult(ZTWXBo ztwxBo) {
        SqlSession sqlSession = DataSourceUtil.getSqlSession();
        String statementId = "jzqb.dao.ZTWXDao.searchZtwxResult";
        return sqlSession.selectList(statementId, ztwxBo, false);
    }

    @Override
    public Long searchZtwxCount(ZTWXBo ztwxBo) {
        SqlSession sqlSession = DataSourceUtil.getSqlSession();
        String statementId = "jzqb.dao.ZTWXDao.searchZtwxCount";
        return sqlSession.getCount(statementId, ztwxBo);
    }

    @Override
    public List<ZTWXBo> getListByztBo(ZTBo bo) {
        SqlSession sqlSession = DataSourceUtil.getSqlSession();
        String statementId = "jzqb.dao.ZTWXDao.getListByztBo";
        return sqlSession.selectList(statementId, bo, false);
    }

    @Override
    public ZTWXBo getDetail(ZTWXBo ztwxBo) {
        SqlSession sqlSession = DataSourceUtil.getSqlSession();
        String statementId = "jzqb.dao.ZTWXDao.getDetail";
        return sqlSession.selectOne(statementId, ztwxBo, false);
    }
}
